from django.urls import path, re_path
from . import views

# from . import views,dbopt,classview

urlpatterns = [
    path('book/', views.BookView.as_view()),

    #  (?P<slug>[^/]+)/ ： 需要views.article_test有个参数名为slug
    re_path('book2/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<slug>[^/]+)/', views.article_test),
    re_path('book2/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/', views.month_test),
    re_path('book2/(?P<year>[0-9]{4})/', views.year_test),
    path('book3/<str:slug>/', views.slug_test2, name='slug_test2'),
    re_path('^book3/(?P<slug>[\w-]+)/delete/$', views.slug_test3),
]
